const webpack = require('webpack')
const merge = require('webpack-merge')

const commonConfig = require('./base.config.js')

module.exports = merge(commonConfig, {
    mode: 'development',

    devtool: 'inline-source-map',

    module: {
        rules: [
            {
                test: /\.css$/,
                use: ['style-loader', 'css-loader']
            },
            {
                test: /\.less$/,
                use: [
                    {
                        loader: 'style-loader'
                    },
                    {
                        loader: 'css-loader'
                    },
                    {
                        loader: 'less-loader',
                        options: {
                            lessOptions: { // antd, // 如果使用less-loader@5，请移除 lessOptions 这一级直接配置选项。
                                modifyVars: {
                                    'primary-color': '#436BFF',
                                    'link-color': '#436BFF',
                                },
                                javascriptEnabled: true
                            }
                        }
                    }
                ]
            }]
    },

    plugins: [
        new webpack.DefinePlugin({
            'process.env.NODE_ENV': JSON.stringify('development')
        }),
    ]
})

